package cn.zhizihua.domain.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author zhizihua
 * @since 2024-12-11
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL) //关联查询结果展示包含非空的字段  （如果字段是空的，转JSON时自动忽略掉了）
@TableName("cart")
public class Cart implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 无意义编号
     */
    @TableId(value = "cartId", type = IdType.AUTO)
    private Integer cartId;

    /**
     * 食品编号
     */
    private Integer foodId;

    /**
     * 所属商家编号
     */
    private Integer businessId;

    /**
     * 所属用户编号
     */
    private Integer userId;

    /**
     * 同一类型食品的购买数量
     */
    private Integer quantity;


    //多表联查
    @TableField(exist = false)
    private Food food;
    @TableField(exist = false)
    private Business business;
    @TableField(exist = false)
    private User user;
}
